package com.urick.spi.dubbo.ext.base;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.urick.spi.dubbo.annotation.Wrapper;
import com.urick.spi.dubbo.ext.IExt;
import com.urick.spi.dubbo.ext.IExtResult;

/**
 * Design Theories:
 * <a href=""></a>
 *
 * @author uRick 2021/12/13 16:04
 * Email: rickwork@163.com
 * Wechat: yy3076815642
 * QQ: 3076815642
 * @since 1.0
 */
@Wrapper(matches = {"baseExt"}, mismatches = {"defExt"})
public class BaseExtWrapper implements IExt {
    private final static Log logger = LogFactory.get();
    private final IExt ext;

    public BaseExtWrapper(IExt ext) {
        this.ext = ext;
    }

    @Override
    public IExtResult exe() {
        IExtResult result = ext.exe();
        logger.info("{}-{}", this.getClass().getSimpleName(), result);
        return result;
    }
}
